{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第3篇：缺失值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在我们拿到一个数据进行统计和分析时，很多时候我们都会遇到这样一个问题：数据缺失，比如学生信息中的某个人的学号和年龄为空，这也是大部分数据分析工作所会遇到的之一。缺失值是数据处理中经常会遇到的数据类型，对于这类数据的该如何处理将是本篇内容将要解决的问题。那么，我们首先会提出一个问题，pandas中有哪些数据是缺失值呢？"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第1部分：何为缺失值\n",
    "缺失值从字面意思上可以理解为当前数据项的值为空，在Python中，提起空值可以想到None，可能也会想到空字符串`\"\"`,那么这两种是否就是pandas中的缺失值呢？这个疑问暂时保留，这里我们引入三种新的空值，np.nan和pd.NAT和pd.NA。下面我们将生成一个包含这几种空值的数据，看看pandas的缺失值到底是什么？"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "所需模块导入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "生成一个含有空值的DataFrame"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>18.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>None</td>\n",
       "      <td>2000-02-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>NaN</td>\n",
       "      <td>&lt;NA&gt;</td>\n",
       "      <td>female</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>NaN</td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age  city      sex       birth\n",
       "name                                  \n",
       "Tom    18.0    北京     None  2000-02-10\n",
       "Bob    30.0    上海     male  2001-12-12\n",
       "Mary    NaN  <NA>   female        None\n",
       "James  40.0    深圳     male  1978-08-08\n",
       "Andy    NaN            NaN         NaT\n",
       "Alice  30.0    晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index = pd.Series(data=[\"Tom\", \"Bob\", \"Mary\", \"James\", \"Andy\", \"Alice\"], name=\"name\")\n",
    "data = {\n",
    "    \"age\": [18, 30, None, 40, np.nan, 30],\n",
    "    \"city\": [\"北京\", \"上海\", pd.NA, \"深圳\", \"\", \"晋城\"],\n",
    "    \"sex\": [None, \"male\", \"female\", \"male\", np.nan, \"unknown\"],\n",
    "    \"birth\": [\"2000-02-10\", \"2001-12-12\", None, \"1978-08-08\", pd.NaT, \"1988-10-17\"]\n",
    "}\n",
    "user_info = pd.DataFrame(data=data, index=index)\n",
    "user_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "age      float64\n",
       "city      object\n",
       "sex       object\n",
       "birth     object\n",
       "dtype: object"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们生成了一个包含None、\"\"、np.nan、pd.NAT、pd.NA的DataFrame，从生成的数据打印结果来看，每种数据类型都有自己的表示方式，下面我们查看一下他们中的哪些属于pandas中的缺失值。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 判断缺失值\n",
    "判断缺失值有两种方式\n",
    "- isna和notna，\n",
    "- isnull和notnull\n",
    "\n",
    "这两种方法的效果是一样的，Series和DataFrame均有此方法。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         age   city    sex  birth\n",
       "name                             \n",
       "Tom    False  False   True  False\n",
       "Bob    False  False  False  False\n",
       "Mary    True   True  False   True\n",
       "James  False  False  False  False\n",
       "Andy    True  False   True   True\n",
       "Alice  False  False  False  False"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.isna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         age   city    sex  birth\n",
       "name                             \n",
       "Tom    False  False   True  False\n",
       "Bob    False  False  False  False\n",
       "Mary    True   True  False   True\n",
       "James  False  False  False  False\n",
       "Andy    True  False   True   True\n",
       "Alice  False  False  False  False"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.isnull()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<function pandas.core.dtypes.missing.isna(obj)>,\n",
       " <function pandas.core.dtypes.missing.isna(obj)>)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.isna, pd.isnull"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从上面打印结果来看，除了空字符串不属于缺失值以外，None、np.nan、pd.NA、pd.NAT均是缺失值。这几种缺失值类型有什么区别呢？"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 缺失值类型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### None: python对象类型的缺失值\n",
    "pandas可以使用None作为缺失值标签，它是一个python对象，它不能作为Numpy/pandas数组类型的缺失值，只能用于'object'数组类型（即由python对象构成的数组）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "首先来回顾一下None的运算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "None == None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# None + None\n",
    "\n",
    "# ---------------------------------------------------------------------------\n",
    "# TypeError                                 Traceback (most recent call last)\n",
    "# <ipython-input-31-87684764322b> in <module>\n",
    "# ----> 1 None + None\n",
    "\n",
    "# TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "None在bool类型的Series中为False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([None], dtype='bool')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "None在bool类型的Series中不会改变其类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True, None], dtype='bool')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "None和数字在一起时，None自动转换为np.nan，Series自动转换为float64类型。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([1, None])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "除非手动指定数据类型为O(object)类型，即表示任何Python数据类型。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       1\n",
       "1    None\n",
       "dtype: object"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([1, None], dtype='O')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "总结：None表示Python数据类型中的缺失值，即Series类型为object时None才会为None，其他类型时会转换成对应的数据类型，比如bool类型时会转换成False,int类型时会转换成pd.nan。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### NaN：数值类型的缺失值\n",
    "NaN: Not a Number，是在任何系统中都兼容的特殊浮点数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "np.nan不等于自己"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.nan == np.nan"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.nan == 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.nan == None"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "np.nan在numpy中的类型为浮点，由此导致数据集读入时，即使原来是整数的列，只要有缺失值就会变为浮点型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "float"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(np.nan)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "2    3\n",
       "dtype: int64"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([1, 2, 3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    NaN\n",
       "2    3.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([1, np.nan, 3])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "此外，对于包含布尔类型和np.nan的Series，会自动转换为object类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True,False])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1      NaN\n",
       "2    False\n",
       "dtype: object"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True,np.nan,False])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如果是np.nan填充，那么它的值会自动变为True而不是False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1     True\n",
       "2    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True,np.nan,False], dtype='bool')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "但当修改一个布尔列表时，会改变列表类型，而不是赋值为True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([True,False],dtype='bool')\n",
    "s[1]=np.nan\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "总结：np.nan是numpy和pandas中的缺失值表示，其自身数据类型为float,但其与空值不同的是，转为布尔值为True,当Series同时包含bool和np.nan时，转为object类型，当Series同时包含int和np.nan时，转为float64类型，两个np.nan不相等。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### pd.NAT：时间类型的缺失值\n",
    "NaT是针对时间序列的缺失值，是Pandas的内置类型，可以完全看做时序版本的np.nan，与自己不等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   2021-01-20\n",
       "dtype: datetime64[ns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_time = pd.Series([pd.Timestamp('20210120')])\n",
    "s_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   2021-01-20\n",
       "1          NaT\n",
       "dtype: datetime64[ns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_time[1] = None\n",
    "s_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   2021-01-20\n",
       "1          NaT\n",
       "2          NaT\n",
       "dtype: datetime64[ns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_time[2] = np.nan\n",
    "s_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   2021-01-20\n",
       "1          NaT\n",
       "2          NaT\n",
       "3          NaT\n",
       "dtype: datetime64[ns]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_time[3] = pd.NaT\n",
    "s_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas._libs.tslibs.nattype.NaTType"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(pd.NaT)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.NaT == pd.NaT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True,False])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1      NaT\n",
       "2    False\n",
       "dtype: object"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True,pd.NaT,False])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1     True\n",
       "2    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([True,pd.NaT,False], dtype='bool')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Nullable类型与NA符号"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这是Pandas在1.0新版本中引入的重大改变，其目的就是为了（在若干版本后）解决之前出现的混乱局面，统一缺失值处理方法\n",
    "> \"The goal of pd.NA is provide a “missing” indicator that can be used consistently across data types (instead of np.nan, None or pd.NaT depending on the data type).\"——User Guide for Pandas v-1.0\n",
    "\n",
    "官方鼓励用户使用新的数据类型和缺失类型pd.NA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Nullable整形**  \n",
    "对于该种类型而言，它与原来标记int上的符号区别在于首字母大写：'Int'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_original = pd.Series([1, 2], dtype=\"int64\")\n",
    "s_original"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "dtype: Int64"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new = pd.Series([1, 2], dtype=\"Int64\")\n",
    "s_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "它的好处就在于，其中前面提到的三种缺失值都会被替换为统一的NA符号，且不改变数据类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "s_original[1] = np.nan"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       1\n",
       "1    <NA>\n",
       "dtype: Int64"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new[1] = np.nan\n",
    "s_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       1\n",
       "1    <NA>\n",
       "dtype: Int64"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new[1] = None\n",
    "s_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       1\n",
       "1    <NA>\n",
       "dtype: Int64"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new[1] = pd.NaT\n",
    "s_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Nullable布尔**  \n",
    "对于该种类型而言，作用与上面的类似，记号为boolean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_original = pd.Series([1, 0], dtype=\"bool\")\n",
    "s_original"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    False\n",
       "1     True\n",
       "dtype: boolean"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new = pd.Series([0, 1], dtype=\"boolean\")\n",
    "s_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    NaN\n",
       "1    0.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_original[0] = np.nan\n",
    "s_original"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    False\n",
       "1    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_original = pd.Series([1, 0], dtype=\"bool\") #此处重新加一句是因为前面赋值改变了bool类型\n",
    "s_original[0] = None\n",
    "s_original"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    <NA>\n",
       "1    True\n",
       "dtype: boolean"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new[0] = np.nan\n",
    "s_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    <NA>\n",
       "1    True\n",
       "dtype: boolean"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new[0] = None\n",
    "s_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    <NA>\n",
       "1    True\n",
       "dtype: boolean"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_new[0] = pd.NaT\n",
    "s_new"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "pd.NA作为索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    cat\n",
       "dtype: object"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series(['dog','cat'])\n",
    "s[s_new]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**string类型**  \n",
    "该类型是1.0的一大创新，目的之一就是为了区分开原本含糊不清的object类型，这里将简要地提及string，因为它是第7章的主题内容\n",
    "它本质上也属于Nullable类型，因为并不会因为含有缺失而改变类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    dog\n",
       "1    cat\n",
       "dtype: string"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series(['dog','cat'],dtype='string')\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    <NA>\n",
       "1     cat\n",
       "dtype: string"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[0] = np.nan\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    <NA>\n",
       "1     cat\n",
       "dtype: string"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[0] = None\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    <NA>\n",
       "1     cat\n",
       "dtype: string"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[0] = pd.NaT\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "此外，和object类型的一点重要区别就在于，在调用字符方法后，string类型返回的是Nullable类型，object则会根据缺失类型和数据类型而改变"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       1\n",
       "1    <NA>\n",
       "2       0\n",
       "dtype: Int64"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([\"a\", None, \"b\"], dtype=\"string\")\n",
    "s.str.count('a')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    NaN\n",
       "2    0.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2 = pd.Series([\"a\", None, \"b\"], dtype=\"object\")\n",
    "s2.str.count(\"a\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    False\n",
       "1     <NA>\n",
       "2    False\n",
       "dtype: boolean"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.str.isdigit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    False\n",
       "1     None\n",
       "2    False\n",
       "dtype: object"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s2.str.isdigit()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 缺失值的运算与分组"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1. 加号与乘号规则"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用加法时，缺失值为0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9.0"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([2,3,np.nan,4])\n",
    "s.sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用乘法时，缺失值为1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "24.0"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.prod()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用累计函数时，缺失值自动略过"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    2.0\n",
       "1    5.0\n",
       "2    NaN\n",
       "3    9.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.cumsum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     2.0\n",
       "1     6.0\n",
       "2     NaN\n",
       "3    24.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.cumprod()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0         NaN\n",
       "1    0.500000\n",
       "2    0.000000\n",
       "3    0.333333\n",
       "dtype: float64"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.pct_change()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2.groupby方法中的缺失值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "自动忽略为缺失值的组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A</td>\n",
       "      <td>0.013885</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>B</td>\n",
       "      <td>1.736015</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>C</td>\n",
       "      <td>1.939304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>D</td>\n",
       "      <td>-1.120659</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.560868</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   one       two\n",
       "0    A  0.013885\n",
       "1    B  1.736015\n",
       "2    C  1.939304\n",
       "3    D -1.120659\n",
       "4  NaN -0.560868"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_g = pd.DataFrame({'one':['A','B','C','D',np.nan],'two':np.random.randn(5)})\n",
    "df_g"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'A': [0], 'B': [1], 'C': [2], 'D': [3]}"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_g.groupby('one').groups"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第2部分：缺失值处理"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1. 丢弃缺失值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Seriese 使用 dropna 比较简单，对于 DataFrame 来说，可以设置更多的参数。\n",
    "> user_info.dropna(axis=0, how='any', thresh=None, subset=None, inplace=False)\n",
    ">- axis 参数用于控制行或列，跟其他不一样的是，axis=0 （默认）表示操作行，axis=1 表示操作列。\n",
    ">- how 参数可选的值为 any（默认） 或者 all。any 表示一行/列有任意元素为空时即丢弃，all 一行/列所有值都为空时才丢弃。\n",
    ">- subset 参数表示删除时只考虑的索引或列名。\n",
    ">- thresh参数的类型为整数，它的作用是，比如 thresh=3，会在一行/列中至少有 3 个非空值时将其保留。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>18.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>None</td>\n",
       "      <td>2000-02-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>NaN</td>\n",
       "      <td>&lt;NA&gt;</td>\n",
       "      <td>female</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>NaN</td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age  city      sex       birth\n",
       "name                                  \n",
       "Tom    18.0    北京     None  2000-02-10\n",
       "Bob    30.0    上海     male  2001-12-12\n",
       "Mary    NaN  <NA>   female        None\n",
       "James  40.0    深圳     male  1978-08-08\n",
       "Andy    NaN            NaN         NaT\n",
       "Alice  30.0    晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "axis参数: 0为行，1为列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age city      sex       birth\n",
       "name                                 \n",
       "Bob    30.0   上海     male  2001-12-12\n",
       "James  40.0   深圳     male  1978-08-08\n",
       "Alice  30.0   晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.dropna(axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: [Tom, Bob, Mary, James, Andy, Alice]"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.dropna(axis=1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "how参数: any或all,默认为any"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age city      sex       birth\n",
       "name                                 \n",
       "Bob    30.0   上海     male  2001-12-12\n",
       "James  40.0   深圳     male  1978-08-08\n",
       "Alice  30.0   晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# any：只有存在至少缺失值就删除该行或该列\n",
    "user_info.dropna(axis=0,how='any')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>18.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>None</td>\n",
       "      <td>2000-02-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>NaN</td>\n",
       "      <td>&lt;NA&gt;</td>\n",
       "      <td>female</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>NaN</td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age  city      sex       birth\n",
       "name                                  \n",
       "Tom    18.0    北京     None  2000-02-10\n",
       "Bob    30.0    上海     male  2001-12-12\n",
       "Mary    NaN  <NA>   female        None\n",
       "James  40.0    深圳     male  1978-08-08\n",
       "Andy    NaN            NaN         NaT\n",
       "Alice  30.0    晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 一行数据所有字段都为空值才删除\n",
    "user_info.dropna(axis=0,how='all')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "subset参数：限定列中查找缺失值是否满足条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age city      sex       birth\n",
       "name                                 \n",
       "Bob    30.0   上海     male  2001-12-12\n",
       "James  40.0   深圳     male  1978-08-08\n",
       "Alice  30.0   晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 一行数据中只要 city 或 sex 存在空值即删除\n",
    "user_info.dropna(axis=0, how=\"any\", subset=[\"city\", \"sex\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2. 填充缺失值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### fillna(): 填充缺失值\n",
    "除了可以丢弃缺失值外，也可以填充缺失值，最常见的是使用 fillna 完成填充。\n",
    "> fillna(value=None,method=None,axis=None,inplace=False,limit=None,downcast=None)\n",
    "\n",
    "fillna 这名字一看就是用来填充缺失值的。\n",
    "填充缺失值时，常见的一种方式是使用一个标量来填充。例如，这里我将有缺失的年龄都填充为 0。\n",
    "\n",
    "除了可以使用标量来填充之外，还可以使用前一个或后一个有效值来填充。\n",
    "设置参数 method='pad' 或 method='ffill' 可以使用前一个有效值来填充。\n",
    "设置参数 method='bfill' 或 method='backfill' 可以使用后一个有效值来填充。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>18.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>None</td>\n",
       "      <td>2000-02-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>NaN</td>\n",
       "      <td>&lt;NA&gt;</td>\n",
       "      <td>female</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>NaN</td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age  city      sex       birth\n",
       "name                                  \n",
       "Tom    18.0    北京     None  2000-02-10\n",
       "Bob    30.0    上海     male  2001-12-12\n",
       "Mary    NaN  <NA>   female        None\n",
       "James  40.0    深圳     male  1978-08-08\n",
       "Andy    NaN            NaN         NaT\n",
       "Alice  30.0    晋城  unknown  1988-10-17"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary      0.0\n",
       "James    40.0\n",
       "Andy      0.0\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.fillna(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary     30.0\n",
       "James    40.0\n",
       "Andy     40.0\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.fillna(method=\"ffill\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary     40.0\n",
       "James    40.0\n",
       "Andy     30.0\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.fillna(method=\"backfill\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### interpolate()：插值\n",
    "除了通过 fillna 方法来填充缺失值外，还可以通过 interpolate 方法来填充。默认情况下使用线性差值，可以是设置 method 参数来改变方式。　\n",
    "> interpolate(method: str = \"linear\",axis: Axis = 0,limit: Optional[int] = None,inplace: bool_t = False,limit_direction: Optional[str] = None,limit_area: Optional[str] = None, downcast: Optional[str] = None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary     35.0\n",
       "James    40.0\n",
       "Andy     35.0\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.interpolate()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 线性插值\n",
    "（a）索引无关的线性插值\n",
    "默认状态下，interpolate会对缺失的值进行线性插值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     1.0\n",
       "1    10.0\n",
       "2    15.0\n",
       "3    -5.0\n",
       "4    -2.0\n",
       "5     NaN\n",
       "6     NaN\n",
       "7    28.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([1,10,15,-5,-2,np.nan,np.nan,28])\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     1.0\n",
       "1    10.0\n",
       "2    15.0\n",
       "3    -5.0\n",
       "4    -2.0\n",
       "5     8.0\n",
       "6    18.0\n",
       "7    28.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.interpolate()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAApjUlEQVR4nO3dd3iV9f3/8ec7G0JIgAxCwt47ByKgKC1OUBSCVUFB+22VDgXEXVtXta1aB2qrVavVCgURCSAqThQXYMiAhD0zSUIgm8zz+f1B/F2Uglknuc99zvtxXbmSHJJzv4TjK3c+9/2+bzHGoJRSyr58rA6glFKqdbTIlVLK5rTIlVLK5rTIlVLK5rTIlVLK5vys2Gh4eLjp06ePFZtWSinb2rp161FjTMTpj1tS5H369CEpKcmKTSullG2JyOEzPa5LK0opZXNa5EopZXNa5EopZXNa5EopZXNa5EopZXNa5EopZXNa5EopZXNa5Eop1Q6qaut5eG0GReXVLn9uLXKllGoHf3p/J298e4iM3FKXP7cWuVJKtbGPMo7w1qbDzJ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aYaVbn+TEicgiIN8bYYsBGRN4EvjLG/FNEAoCOxphii2P9qIYuywHGG2NaOhj5X+y0Rz4O2GeMOWCMqQGWA9MtznRWxpiNwDGrczSFMSbPGJPc8HEZsBOIsTbVmZmTyhs+9W94c9u9ERGJBa4A/ml1Fk8jIp2BScBrAMaYGncv8QYXAftdVeJgryKPAbJO+TwbNy0bOxORPoAD2GxxlLNqWKpIBQqAT4wxbpsVWAzcAzgtztFUBvhYRLY23DDdnfUDCoF/NSxd/VNEgq0O1QSzgGWufEI7Fbmc4TG33ROzIxHpBLwL3G6MKbU6z9kYY+qNMXFALDBORNxy6UpEpgEFxpitVmdphonGmDHAVODWhiVCd+UHjAFeMsY4gArA3Y+dBQBXAe+48nntVOTZQM9TPo8Fci3K4nEa1pvfBZYaY1ZZnacpGn6N/gKYYm2Ss5oIXNWw7rwcuFBEllgb6ccZY3Ib3hcAiZxc0nRX2UD2Kb+RreRksbuzqUCyMSbflU9qpyL/HhgoIn0bfqrNAtZanMkjNBxAfA3YaYx5xuo8P0ZEIkQkrOHjDsDFwC5LQ52FMeZ3xphYY0wfTr5ePzfGzLE41lmJSHDDwW4aliguxY1vqG6MOQJkicjghocuAtzuAP1pZuPiZRVo/c2X240xpk5EbgM+AnyB140xGRbHOisRWQb8FAgXkWzgIWPMa9amOquJwFxge8PaM8D9xpgPrIt0VtHAmw1H/n2AFcYYtz+tzyaigMSTP9fxA/5jjFlvbaRGzQeWNuzcHQD+z+I8ZyUiHTl51p3Lb1Jvm9MPlVJKnZmdllaUUkqdgRa5UkrZnBa5UkrZnBa5UkrZnBa5UkrZnBa5UkrZnBa5UkrZ3P8DgU56JQgeJPIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s.interpolate().plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "此时的插值与索引无关"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "62      1.0\n",
       "77     10.0\n",
       "96     15.0\n",
       "119    -5.0\n",
       "121    -2.0\n",
       "212     8.0\n",
       "263    18.0\n",
       "265    28.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.index = np.sort(np.random.randint(50,300,8))\n",
    "s.interpolate()\n",
    "# 值不变"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAkwUlEQVR4nO3deXxU9b3/8dc3KyTsYcIewhKCCAgSQYRCotel1F1rVcSFWrQtrb31Lra9t7Xt797bem17W2trUVA20Vpt0dZqLRKRnYAgIIQAIRAIWVhCyJ7M9/dHhjbFBLLMzJmZ834+HnkwOTOZ8/HM8Z2T73zn+zHWWkREJPJFOV2AiIgEhwJfRMQlFPgiIi6hwBcRcQkFvoiIS8Q4sdO+ffva1NRUJ3YtIhK2tm7dWmat9XT05x0J/NTUVHJycpzYtYhI2DLGFHTm5zWkIyLiEgp8ERGXUOCLiLiEAl9ExCUU+CIiLqHAFxFxCQW+iIhLKPBFRILgeHkNP/lLLgdLzzpWgwJfRCQIjpyq4pn393P0dLVjNSjwRUSC4GxtAwAJcY4scAAo8EVEgqLSF/jd4hX4IiIR7VzgJ8ZHO1aDAl9EJAjO1jYCusIXEYl4VRrDFxFxh7N1DcRFRxEX41zsK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HZp+e+cCnw1iTftpGrvc7vt6zvfYO4DdNM1c2AbcFORj1epr5tSx8m1/CXj0vMcG5VgB02kaZvi42es1KwTOq9bqcuzcukBNTp9XLdblz3NLSyuIiLiEG4d0RERcSYEvIuISCnwREZdQ4IuIuIQCX0TEJRT4IiIuocAXEXGJ/w+QfOcd1IfmBgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s.interpolate().plot()\n",
    "# 后面三个点不是线性的（如果几乎为线性函数，请重新运行上面的一个代码块，这是随机性导致的）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(b) 与索引有关的插值  \n",
    "method中的index和time选项可以使插值线性地依赖索引，即插值为索引的线性函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAobUlEQVR4nO3deXhU5d3/8fedsO/bhH0nBFEQJBAkCknt4tIKKqiogAqiglXbPs9Tq13s8vNRu9rWqggqu7ghtLW21oIKhCUBZN9J2LMBSUjIOvfvjwx9Uk1CQmbmzMz5vK4rF8OZyZzvdebw4cz9vc85xlqLiIhEviinCxARkeBQ4IuIuIQCX0TEJRT4IiIuocAXEXGJRk6stFOnTrZPnz5OrFpEJGylpaXlWGs9l/r7jgR+nz59SE1NdWLVIiJhyxiT0ZDf15COiIhLKPBFRFxCgS8i4hIKfBERl1Dgi4i4hAJfR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bwJ3W9/Aoe+rba7vcRqVY5oDg1VTLZ+Z09uqEXArsKxKrUHbVsaYxlQGxWJr7Xu+xY7vVzXU5ei+VV1NobBf1bKt/LJvuTHw/+N/SRM6N2JfCUzzPZ4GrKiy/E5jTFNjTF8gFtgYjIKMMdcD3wduttYWVVnuMcZE+x7389V0KBg1+dZZ02fm2Lby+Sqwx1p77MKCYG0r3/juPGC3tfY3VZ5ydL+qqS4n961aanJ0v6rlMwR/7Vv+7jSH8g/QAsgF2lZZthDYDmyj8oPtGoQ6llL5dayMyqOH6UBH4GNgv+/PDlVe/xSV/3vvBW4IYk0HqBy73Or7edn32tuAnVTOXNgMfCvI26rGz8ypbeVb/gbw0BdeG5RtBVxD5TDDtiqf140hsF/VVJdj+1YtNTm9X1Vblz/3LV1aQUTEJdw4pCMi4koKfBERl1Dgi4i4hAJfRMQlFPgiIi6hwBcRcQkFvoiIS/x/TAgZoufaqzcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s.interpolate(method='index').plot()\n",
    "#可以看到与上面的区别"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如果索引是时间，那么可以按照时间长短插值，对于时间序列将在后续章节详细介绍"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2020-05-01     0.0\n",
       "2020-05-07     NaN\n",
       "2020-06-03    10.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s_t = pd.Series([0,np.nan,10]\n",
    "        ,index=[pd.Timestamp('2020-05-01'),pd.Timestamp('2020-05-07'),pd.Timestamp('2020-06-03')])\n",
    "s_t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAD/CAYAAAAe7cpbAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAkfUlEQVR4nO3dd3wc9Z3/8ddHsuVeZblIxt3G3ZIxHdMNNgYsX8qRBJIQAnckIaQfGDg4Qrsjl/K7X8qD5C7JXbgQkmDZ9E5CSRwMknEF2xiMVy5yr5Il7ef+mLEsjA2yvLszu3o/H499aGd3rHl7drSf3fnMfMfcHREREYC8qAOIiEh8qCiIiEgTFQUREWmioiAiIk1UFEREpImKgoiINGkXdYBj0adPHx8yZEjUMUREssprr7222d2LDvdcVheFIUOGsHDhwqhjiIhkFTN790jPafeRiIg0UVEQEZEmKgoiItIkkqJgZv9lZpvMbEmzx3qb2dNmtjL82SuKbCIibVlU3xR+BUw/5LEbgGfdfSTwbDgtIiIZFElRcPc/A1sPeXgW8Ovw/q+B8kxmEhGReB2S2s/d1wO4+3oz6xt1IBGROHF3lq/fRUVVgg7t8vjmBcenfBlxKgotYmbXANcADBo0KOI0IiLpl9i+j3lVCSoqE7y1cTft8oxLJxWnZVlxKgobzWxA+C1hALDpcDO5+33AfQBTpkzRFYJEJCft2FvPo4vXU1GV4G9rgr3tJwzuxXdnjWPmxGJ6dylIy3LjVBTmA58D7gl/zos2johIZtXWN/L8ik1UVCV4fkUN+xuTDCvqwjenjWJWaQmDCjunPUMkRcHMfgucDfQxs3XArQTF4EEzuwpYC3wiimwiIpmUTDoL1mylojLBY0vWs6u2gaJuHbj8lMHMLithfEl3zCxjeSIpCu7+qSM8dV5Gg4iIRGT5+p1UVCaYv6ia9Ttq6VKQz4Xj+zO7rIRThxXSLj+aMwbitPtIRCSnVW/fx7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Av8DXgNWBM+nk9wndKl4ayLCYbT/aGZlROcVm6Eh4p5CselVyZlSlWmuOVRpmiW19YcdVEwMyO4zun/ElwUezVwNcEAVBstHAfEgouc94Cmlf+r8IiAGwgGG7vaUzRmijIpU6oyxS2PMsV3HeSso/lawcExy0cBvwnvtyMYd/6hQ+b5b+CT4f3+zX5HQSq/6iiTMuVqHmWK7zrI5VuLvimEJ3vcDuSb2WMEFyBphOCYXzP7KlBtZme5+5/Cf7YbWGNmtwN/Z2bT3X2du6fkGGBlUqZUZYpbHmWK7zpoEz6qahCMZ76I4KIVVxN0+acT7NM7qdl81wLPh/fzCa5R+i7BoFKpvoKWMilTTuZRpviug7Zya8mLMxW4otn0T8IX4vPAa+FjeQT7+x4kGG1wePiiTE5LaGVSphzNo0zxXQdt5daSF6cz0IGD++w+A9wd3q8CrgvvTwEeyEhoZVKmHM2jTPFdB23l9pFjH7n7Xnev84NXFppGcHlHCK6GNMbMHgF+S3B42AeGqk01ZVKmXM2jTNEsTw5q8SGp4THADvQjOAEEYBfBqeXjgTXunoDMjTeuTMqUq3mUKZrlydGNkpokOOljMzAxrNK3AEl3f+nAC5NhyqRMuZpHmaJZnhzNviaCU8qTwEvAVVHv+1ImZcrlPMoU33WQyzcLV3qLmNlAgrFFvu/udUdTfNJFmVpGmbIvDyhTFMtr646qKIiISG47mp6CiIjkOBUFERFpoqIgIiJNVBRERKSJioKIiDRRURARkSYqCiIi0kRFQUREmvwfgvZx0UcUUYMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s_t.interpolate().plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGg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RtXaftbbUfn9moaE4p3cE52xIPY0xM4E3cIaH/c+hagNNmZSpruZRJm+WJ9874iGp7hhgC7TC+QEIwB6cn5b3BtZYazdA6I43rkzKVFfzKJM3y5PaHSW1CudHH9uAvm5L/wmostYuPvDAhJgyKVNdzaNM3ixParOvCecn5VXAYmCs1/u+lEmZ6nIeZfLvOqjLF+Ou9CNijGmPc2yRv1lrS2tTPsGiTEdGmcIvDyiTF8ur72pVCiIiUrfV5jsFERGp41QKIiJSTaUgIiLVVAoiIlJNpSAiItVUCiIiUk2lICIi1VQKIiJS7f8BdHWPEUQG1rMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "s_t.interpolate(method='time').plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 高级插值方法\n",
    "此处的高级指的是与线性插值相比较，例如样条插值、多项式插值、阿基玛插值等（需要安装Scipy），方法详情请看[这里](https://pandas.pydata.org/pandas-docs/version/1.0.0/reference/api/pandas.DataFrame.interpolate.html#pandas.DataFrame.interpolate)  \n",
    "关于这部分仅给出一个官方的例子，因为插值方法是数值分析的内容，而不是Pandas中的基本知识："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:>"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAocUlEQVR4nO3dd3hUVeLG8e+ZSaO3UAUMKIJ0ISCgFAWkiCIKAiqCsqJS1LUAoiuI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n54tpyOCudyzuk5rQP7HSeb/wd8aY+J8144NdKWttXshswSAUg7nOZf+xpg1vmkbx6ePTmeMiQGuAX4mgPfpX3JCAO5TY4zbGLMaOADMs9YG5D49S05wYJ8Gc7mf9zqtAeQ6a209oB3QzzfFINn3JnAFUBfYC7ziaJrTGGMKAh8Dj1lrjzqd52yyyBmQ+9Ra67HW1iXzkp0NjTE1HY6UpbPkdGSfBnO5B811Wq21e3y3B4BPyZxSCmT7fXOyf87NHnA4T5astft9v0xeYBIBsl99860fA9OstZ/4FgfcPs0qZ6Du0z9Za5OAhWTOYwfcPv3T6Tmd2qfBXO5BcZ1WY0wB3wdWGGMKADcB6869luPmAj1993sCcxzMclZ//mL7dCIA9qvvQ7W3gY3W2nGnPRVQ+/RsOQN0n5Y0xhT13c8HtAJ+I/D2aZY5ndqnQXu0DIDvkKJ/8//XaR3pbKK/M8ZUJnO0DpmXNZweSDmNMR8ALcg8Nel+YCgwG5gJVAR2AV2stY5+mHmWnC3I/FPXAjuAB/+cg3WKMeZ6YDGwFvD6Fg8hcz47YPbpOXJ2J/D2aW0yPzB1kzkgnWmtHW6MKUFg7dOz5XwPB/ZpUJe7iIhkLZinZURE5CxU7iIiIUjlLiISglTuIiIhSOUuIhKCVO4iIiFI5S4iEoL+DwYb3Iv1stsOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "ser = pd.Series(np.arange(1, 10.1, .25) ** 2 + np.random.randn(37))\n",
    "missing = np.array([4, 13, 14, 15, 16, 17, 18, 20, 29])\n",
    "ser[missing] = np.nan\n",
    "methods = ['linear', 'quadratic', 'cubic']\n",
    "df = pd.DataFrame({m: ser.interpolate(method=m) for m in methods})\n",
    "df.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### interpolate中的限制参数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（a）limit表示最多插入多少个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    2.0\n",
       "2    3.0\n",
       "3    NaN\n",
       "4    5.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([1,np.nan,np.nan,np.nan,5])\n",
    "s.interpolate(limit=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（b）limit_direction表示插值方向，可选forward,backward,both，默认前向"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    1.0\n",
       "2    1.0\n",
       "3    2.0\n",
       "4    3.0\n",
       "5    4.0\n",
       "6    5.0\n",
       "7    NaN\n",
       "8    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([np.nan,np.nan,1,np.nan,np.nan,np.nan,5,np.nan,np.nan,])\n",
    "s.interpolate(limit_direction='backward')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（c）limit_area表示插值区域，可选inside,outside，默认None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    NaN\n",
       "1    NaN\n",
       "2    1.0\n",
       "3    2.0\n",
       "4    3.0\n",
       "5    4.0\n",
       "6    5.0\n",
       "7    NaN\n",
       "8    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([np.nan,np.nan,1,np.nan,np.nan,np.nan,5,np.nan,np.nan,])\n",
    "s.interpolate(limit_area='inside')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    NaN\n",
       "1    NaN\n",
       "2    1.0\n",
       "3    NaN\n",
       "4    NaN\n",
       "5    NaN\n",
       "6    5.0\n",
       "7    5.0\n",
       "8    5.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([np.nan,np.nan,1,np.nan,np.nan,np.nan,5,np.nan,np.nan,])\n",
    "s.interpolate(limit_area='outside')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3. 替换缺失值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "例如，在我们的存储的用户信息中，假定我们限定用户都是青年，出现了年龄为 40 的，我们就可以认为这是一个异常值。再比如，我们都知道性别分为男性（male）和女性（female），在记录用户性别的时候，对于未知的用户性别都记为了 “unknown”,很明显，我们也可以认为“unknown”是缺失值。此外，有的时候会出现空白字符串，这些也可以认为是缺失值。对于上面的这种情况，我们可以使用 replace 方法来替换缺失值。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>18.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>None</td>\n",
       "      <td>2000-02-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>NaN</td>\n",
       "      <td>&lt;NA&gt;</td>\n",
       "      <td>female</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>40.0</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>1978-08-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>NaN</td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age  city      sex      birth\n",
       "name                                 \n",
       "Tom    18.0    北京     None 2000-02-10\n",
       "Bob    30.0    上海     male 2001-12-12\n",
       "Mary    NaN  <NA>   female        NaT\n",
       "James  40.0    深圳     male 1978-08-08\n",
       "Andy    NaN            NaN        NaT\n",
       "Alice  30.0    晋城  unknown 1988-10-17"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "index = pd.Series(data=[\"Tom\", \"Bob\", \"Mary\", \"James\", \"Andy\", \"Alice\"], name=\"name\")\n",
    "data = {\n",
    "    \"age\": [18, 30, None, 40, np.nan, 30],\n",
    "    \"city\": [\"北京\", \"上海\", pd.NA, \"深圳\", \" \", \"晋城\"],\n",
    "    \"sex\": [None, \"male\", \"female\", \"male\", np.nan, \"unknown\"],\n",
    "    \"birth\": [\"2000-02-10\", \"2001-12-12\", pd.NaT, \"1978-08-08\", np.nan, \"1988-10-17\"]\n",
    "}\n",
    "user_info = pd.DataFrame(data=data, index=index)\n",
    "user_info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary      NaN\n",
       "James     NaN\n",
       "Andy      NaN\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.replace(40,np.nan)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary      NaN\n",
       "James     NaN\n",
       "Andy      NaN\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.replace({40: np.nan})#制定一个映射字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>age</th>\n",
       "      <th>city</th>\n",
       "      <th>sex</th>\n",
       "      <th>birth</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>name</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Tom</th>\n",
       "      <td>18.0</td>\n",
       "      <td>北京</td>\n",
       "      <td>None</td>\n",
       "      <td>2000-02-10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bob</th>\n",
       "      <td>30.0</td>\n",
       "      <td>上海</td>\n",
       "      <td>male</td>\n",
       "      <td>2001-12-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Mary</th>\n",
       "      <td>NaN</td>\n",
       "      <td>&lt;NA&gt;</td>\n",
       "      <td>female</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>James</th>\n",
       "      <td>NaN</td>\n",
       "      <td>深圳</td>\n",
       "      <td>male</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Andy</th>\n",
       "      <td>NaN</td>\n",
       "      <td></td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Alice</th>\n",
       "      <td>30.0</td>\n",
       "      <td>晋城</td>\n",
       "      <td>unknown</td>\n",
       "      <td>1988-10-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        age  city      sex      birth\n",
       "name                                 \n",
       "Tom    18.0    北京     None 2000-02-10\n",
       "Bob    30.0    上海     male 2001-12-12\n",
       "Mary    NaN  <NA>   female        NaT\n",
       "James   NaN    深圳     male        NaT\n",
       "Andy    NaN            NaN        NaT\n",
       "Alice  30.0    晋城  unknown 1988-10-17"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 字典多列筛选\n",
    "user_info.replace({\"age\": 40, \"birth\": pd.Timestamp(\"1978-08-08\")}, np.nan)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom        None\n",
       "Bob        male\n",
       "Mary     female\n",
       "James      male\n",
       "Andy        NaN\n",
       "Alice       NaN\n",
       "Name: sex, dtype: object"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.sex.replace(\"unknown\", np.nan)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom        北京\n",
       "Bob        上海\n",
       "Mary     <NA>\n",
       "James      深圳\n",
       "Andy      NaN\n",
       "Alice      晋城\n",
       "Name: city, dtype: object"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.city.replace(r'\\s+', np.nan, regex=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "除了我们自己手动丢弃、填充已经替换缺失值之外，我们还可以使用其他对象来填充。\n",
    "例如有两个关于用户年龄的 Series，其中一个有缺失值，另一个没有，我们可以将没有的缺失值的 Series 中的元素传给有缺失值的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary     20.0\n",
       "James    40.0\n",
       "Andy     20.0\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "age_new = user_info.age.copy()\n",
    "age_new.fillna(20, inplace=True)\n",
    "age_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "name\n",
       "Tom      18.0\n",
       "Bob      30.0\n",
       "Mary     20.0\n",
       "James    40.0\n",
       "Andy     20.0\n",
       "Alice    30.0\n",
       "Name: age, dtype: float64"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "user_info.age.combine_first(age_new)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 简单小结"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由于数据的来源的复杂性、不确定性，数据中难免会存在字段值不全、缺失等情况，本文介绍了在pandas中，None、np.nan、pd.NaT和pd.NA都会被识别为缺失值，其中None特指Python对象数据类型的缺失值，np.nan表示numpy中的缺失值，np.nan的类型为float,pd.NaT特指为时间类型的缺失值，在 Pandas 1.0 以后为了统一对缺失值表示和处理，实验性地使用一个标量 pd.NA 来代表。接下来介绍了pandas中如何判断缺失值以及处理缺失值的几种方法，学会本篇内容之后，相信你已经对缺失值相关的操作技巧和知识有了一定的了解。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "272px"
   },
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
